package com.aaa.java10;

/**
 * @author ：Teacher陈（86521760@qq.com）
 * @date ：Created in 2022/7/13 16:03
 * @description：
 * @modified By：
 * @version:
 */
public class Person {
    private String name;
    private int  age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {

        return age;
    }

    public void setAge(int age) throws MyException  {
        if(age>150||age<=0){
            throw new MyException();
        }
        this.age = age;
    }


}
